<?php

/*
 *
 *
 * This software has been made FREELY available by author for interest of the developers. 
 *      I hope this will help you in coding faster and robust php application
 *            You can modify and use it as you it suits you.
 *              Your comments, suggestions and corrections 
 *                          will be highly 
 *                           APPRECIATED. 
 *                                      Thanks, 
 *                                      Author
 * @author :   Roshan Budhathoki (contact@roshanbudhathoki.com);
 * @URL    :   <http://www.roshanbudhathoki.com>
 *
 */

abstract class Model {
	function _makeWhere($args){
		if(!is_array($args)){
			throw new Exception('Argument Array Expected');
		}
		$columns=array();
		$values=array();
		foreach($args as $key=> $value){
			$columns[]=$key.'=?';
			$values[]=$value;
		}
		if(count($values)==1){
			$values=$values[0];
		}
		$return=array();
		$return['sql']=implode(' AND ',$columns);
		$return['values']=$values;
		
		return $return;
	}
	
}